<template>
	<view>
		<!-- <view class="" :style="'height:'+statusBarHeight+'rpx'"></view> -->
		<u-navbar :placeholder="true" leftIconColor='#FFFFFF' :autoBack="true" bgColor="#F2F2F2">
			<view class="navbarleft flex" slot='left'>
				<u-icon name="arrow-left" :bold="true"></u-icon>
				<view class="" style="margin-left: 40rpx;">
					<view class="text1">{{title}}火豆</view>
					<view class="text2">单价 ￥10.12</view>
				</view>
			</view>
		</u-navbar>
		<view class="ordermain">
			<view class="ordermain_top">
				<view class="left flex">
					<view class="left_text" @click="btnsel(1)">
						<view class="name" :class="isline==1?'isname':''">按金额</view>
						<view class="left_line" :class="isline==1?'isline':''"></view>
					</view>
					<view class="left_text" @click="btnsel(2)">
						<view class="name" :class="isline==2?'isname':''">按数量</view>
						<view class="left_line" :class="isline==2?'isline':''"></view>
					</view>
				</view>
			</view>
			<view class="ordermain_center flex-between">
				<input type="text" placeholder="0.00" />
				<view class="" v-if="isline==1">
					元 <span>最大</span>
				</view>
				<view class="" v-if="isline==2">
					火豆 <span>最大</span>
				</view>
			</view>
			<view class="maxnum" v-if="isline==1">最大 ￥9,888.06</view>
			<view class="maxnum" v-if="isline==2">最大数量 9,888.06</view>
			<view class="text" v-if="isline==1">可得 0火豆</view>
			<view class="text" v-if="isline==2">应付 ￥0.00</view>
		</view>
		<view class="paytype flex-between" @click="showtype=true">
			<view class="" v-if="type==1">支付方式</view>
			<view class="" v-if="type==2">收款方式</view>
			<view class="flex">
				<image class="img" :src="typeimg" mode=""></image>
				<text>{{paytype?paytype:'选择'}}</text>
				<image src="../../static/wallet/goin.png" mode=""></image>
			</view>
		</view>
		<view class="paytype flex-between">
			<view class="">卖家昵称</view>
			<view class="flex" style="padding-right: 30rpx;">哈哈哈</view>
		</view>
		<u-picker :show="showtype" :columns="columnstype" keyName='nmae' @confirm="confirm"
			@cancel="showtype=false"></u-picker>
		<view class="btnsub" @click="$fun.jump(`./orderdetails?type=${type}`)">
			{{title}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusBarHeight: 0,
				isline: 1,
				showtype: false,
				columnstype: [
					[{
						nmae: '微信',
						url: '../../static/wallet/wechat.png',
						id: 1
					}, {
						nmae: '支付宝',
						url: '../../static/wallet/Alipay.png',
						id: 2
					}, {
						nmae: '银行卡',
						url: '../../static/wallet/backid.png',
						id: 3
					}]
				],
				paytype: '',
				typeimg: '',
				title: '',
				type: 1
			}
		},
		onLoad(option) {
			this.title = option.title
			this.type = option.type
		},
		onShow() {
			const phoneInfo = uni.getSystemInfoSync(); // 获取手机系统信息
			this.statusBarHeight = phoneInfo.statusBarHeight
		},
		methods: {
			btnsel(res) {
				this.isline = res
			},
			confirm(e) {
				console.log(e)
				this.paytype = e.value[0].nmae
				this.typeimg = e.value[0].url
				this.showtype = false
			},
		}
	}
</script>

<style lang="scss" scoped>
	.navbarleft {
		font-weight: 600;
		font-size: 32rpx;
		color: #19181A;

		.text2 {
			font-weight: 400;
			font-size: 24rpx;
			color: #19181A;
		}
	}

	.ordermain {
		width: 690rpx;
		height: 381rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		margin: 30rpx auto;
		box-sizing: border-box;
		padding: 0 30rpx;

		&_top {
			padding-top: 20rpx;

			.left {
				font-weight: 500;
				font-size: 32rpx;
				color: #999999;

				&_text {
					margin-right: 60rpx;
				}

				&_line {
					width: 36rpx;
					height: 8rpx;
					border-radius: 4rpx;
					margin: 20rpx auto 0;
				}

				.isline {
					background: #9999FF;
				}

				.isname {
					color: #333333;
				}
			}
		}

		&_center {
			font-weight: 500;
			font-size: 32rpx;
			color: #333333;
			margin-top: 60rpx;
			border-bottom: 1rpx solid #666666;
			padding-bottom: 20rpx;

			span {
				color: #9999FF;
				margin-left: 30rpx;
			}
		}

		.maxnum {
			font-weight: 400;
			font-size: 24rpx;
			color: #999999;
			margin-top: 20rpx;
		}

		.text {
			font-weight: 400;
			font-size: 28rpx;
			color: #333333;
			margin-top: 50rpx;
		}
	}

	.paytype {
		width: 690rpx;
		height: 88rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		font-weight: 500;
		font-size: 28rpx;
		color: #333333;
		padding-left: 30rpx;
		box-sizing: border-box;
		margin: 0 auto 30rpx;

		text {
			color: #999999;
		}

		image {
			width: 48rpx;
			height: 48rpx;
		}

		.img {
			width: 23rpx;
			height: 23rpx;
			margin-right: 10rpx;
		}
	}
</style>